/**   
* @Title: DaletouInfo.java 
* @Package com.esun.model 
* @Description: (大乐透购彩相关信息) 
* @author: City Jiangsy@500wan.com   
* @date: 2011-7-5 上午10:47:44  
* Copyright: (C) 2011 Shenzhen E-sun Sky Net Technology Co.,ltd.
*/
package com.esun.model;

import java.util.ArrayList;
import java.util.HashMap;

/** 
 * @ClassName: DaletouInfo 
 * @Description:(大乐透购彩相关信息) 
 * @author: City Jiangsy@500wan.com
 * @date: 2011-7-5 上午10:47:44 
 *  
 */
public class DaletouInfo {
	private static DaletouInfo daletouInfo = null;
	public static DaletouInfo getDaletouInfo(){
		if(daletouInfo == null){
			return daletouInfo = new DaletouInfo();			
		}else{
			return daletouInfo;
		}
	}
	private String termNum;
	
	private String timeLeft;
	
	private int redBallCount = 0;

	private int blueBallCount = 0;
	
	private int betCount;
	
	//------------------2012-02-22 added by kuroky---------------------//
	// 奖池金额
	private String lotteryPoolMoney ;
	// 是否加奖
	private boolean isAddMoney ;
	//------------------2012-02-22 added by kuroky---------------------//
	
	
	private ArrayList<HashMap<String, Object>> lotteryList = new ArrayList<HashMap<String, Object>>();
	
	public ArrayList<HashMap<String, Object>> getLotteryList() {
		return lotteryList;
	}

	/*public void setLotteryList(ArrayList<HashMap<String, Object>> lotteryList) {
		this.lotteryList = lotteryList;
	}*/

	public int getBetCount() {
		if((!(getRedBallCount()<5))&&(!(getBlueBallCount()<2))){
			betCount = getVoteline(getRedBallCount(), 5)*getVoteline(getBlueBallCount(), 2);			
		}else{
			betCount = 0;
		}
		return betCount;
	}

	public void setBetCount(int betCount) {
		this.betCount = betCount;
	}

	public int getRedBallCount() {
		return redBallCount;
	}

	public void setRedBallCount(int redBallCount) {
		this.redBallCount = redBallCount;
	}

	public int getBlueBallCount() {
		return blueBallCount;
	}

	public void setBlueBallCount(int blueBallCount) {
		this.blueBallCount = blueBallCount;
	}

	public String getTermNum() {
		return termNum;
	}

	public void setTermNum(String termNum) {
		this.termNum = termNum;
	}

	public String getTimeLeft() {
		return timeLeft;
	}

	public void setTimeLeft(String timeLeft) {
		this.timeLeft = timeLeft;
	}
	
	//组合公式    C(n,m) = n!/(m!(n-m)!) 从N个数里选M个
	public static int getVoteline(int n, int m){
	    
	    int f=1;
        for(int i = 1;i <= m;i++)
            f = f*(i+(n-m))/i;
        
        return f;

    }
	
	//------------------2012-02-22 added by kuroky---------------------//

	public String getLotteryPoolMoney() {
		return lotteryPoolMoney;
	}

	public void setLotteryPoolMoney(String lotteryPoolMoney) {
		this.lotteryPoolMoney = lotteryPoolMoney;
	}

	public boolean isAddMoney() {
		return isAddMoney;
	}

	public void setAddMoney(boolean isAddMoney) {
		this.isAddMoney = isAddMoney;
	}
	
	//------------------2012-02-22 added by kuroky---------------------//
}
